package com.gang.mars.basic.generictype.demo9.annotation;

/**
 * @Author：gang.chen
 * @Date：2023/6/14 14:05
 */
final class GangTypeMappedAnnotation<A extends GangAnnotation> extends GangAbstractMergedAnnotation<A>
{

    private final Object rootAttribute;

    private final Class<? extends GangAnnotation> annotationType;

    GangTypeMappedAnnotation(Object rootAttribute, Class<? extends GangAnnotation> annotationType) {
        this.rootAttribute = rootAttribute;
        this.annotationType = annotationType;
    }

    @Override
    public A createSynthesizedAnnotation() {
        return (A) this.rootAttribute;
    }

    @Override
    public Class<A> getType() {
        return (Class<A>) annotationType;
    }
}
